package com.fangngng.pushall.service;


import com.fangngng.pushall.dto.AddTopicRemindVO;
import com.fangngng.pushall.dto.AddTopicVO;
import com.fangngng.pushall.dto.EditTopicRemindTimeVO;
import com.fangngng.pushall.dto.EditTopicRemindVO;
import com.fangngng.pushall.dto.EditTopicVO;
import com.fangngng.pushall.dto.RequestTopicVO;
import com.fangngng.pushall.dto.Result;
import com.fangngng.pushall.dto.TopicQuery;
import com.fangngng.pushall.dto.TopicVO;
import com.fangngng.pushall.entity.Remind;
import com.fangngng.pushall.entity.RemindTime;
import com.fangngng.pushall.entity.Topic;
import com.fangngng.pushall.entity.User;
import com.fangngng.pushall.entity.UserSubcribe;
import com.github.pagehelper.PageInfo;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.List;

/**
 * @author fei.fang
 * @date 2020/7/2
 **/
public interface TopicService {

    /**
     * 最热的 10 个 topic
     *
     * @return
     */
    List<Topic> getHottest10Topic();

    /**
     * 最新的 10 个 topic
     *
     * @return
     */
    List<Topic> getNewtest10Topic();

    /**
     * 订阅主题
     *
     * @param topicCode
     * @param userEmail
     * @return
     */
    Result<String> subscribeTopic(String topicCode, String userEmail);

    /**
     * 退订主题
     *
     * @param userEmail
     * @param topicCode
     * @return
     */
    Result<String> unSubscribeTopic(String userEmail, String topicCode);

    Topic getTopicByCode(String code);

    TopicVO getTopicVOByCode(String code);

    /**
     * 查询创建的主题
     *
     * @param pageNumber
     * @param pageSize
     * @param sort
     * @param topicQuery
     * @return
     */
    PageInfo<Topic> getTopicByPage(int pageNumber, int pageSize, String sort, TopicQuery topicQuery);

    /**
     * 查询订阅的主题
     *
     * @param pageNumber
     * @param pageSize
     * @param sort
     * @param topicQuery
     * @return
     */
    PageInfo<Topic> getSubTopicByPage(int pageNumber, int pageSize, String sort, TopicQuery topicQuery);

    /**
     * 添加主题
     *
     * @param addTopicVO
     * @param email
     * @return
     */
    Topic addTopic(AddTopicVO addTopicVO, String email);

    /**
     * 编辑主题
     *
     * @param editTopicVO
     * @param email
     * @return
     */
    Result<String> editTopic(EditTopicVO editTopicVO, String email);

    /**
     * 删除主题
     *
     * @param topicId
     * @param userEmail
     * @return
     */
    Result<String> deleteTopic(Integer topicId, String userEmail);

    /**
     * 添加主题的提醒
     * @param remindVO
     * @param email
     * @return
     */
    Remind addTopicRemind(AddTopicRemindVO remindVO, String email);

    /**
     * 编辑主题的提醒
     * @param remindVO
     * @param email
     * @return
     */
    Remind editTopicRemind(EditTopicRemindVO remindVO, String email);

    /**
     * 编辑主题的提醒
     * @param remindId
     * @param email
     * @return
     */
    Result<String> deleteTopicRemind(Integer remindId, String email);

    /**
     * 编辑主题的提醒
     * @param remindVO
     * @param email
     * @return
     */
    RemindTime editTopicRemindTime(EditTopicRemindTimeVO remindVO, String email);

    /**
     * 编辑主题的提醒
     * @param remindTimeId
     * @param email
     * @return
     */
    Result<String> deleteTopicRemindTime(Integer remindTimeId, String email);

    Integer saveTopic(Topic topic);

    Integer saveSubscribe(UserSubcribe userSubcribe);

    List<Topic> getUserSubscribeTopic(String userName);

    PageInfo<Topic> findPage(RequestTopicVO topicVO);
}
